3.1.3 \(\int (c+d x) \text {sech}(a+b x) \, dx\) [3]

Optimal. Leaf size=61 \[ \frac {2 (c+d x) \text {ArcTan}\left (e^{a+b x}\right )}{b}-\frac {i d \text {PolyLog}\left (2,-i e^{a+b x}\right )}{b^2}+\frac {i d \text {PolyLog}\left (2,i e^{a+b x}\right )}{b^2} \]

[Out]

2*(d*x+c)*arctan(exp(b*x+a))/b-I*d*polylog(2,-I*exp(b*x+a))/b^2+I*d*polylog(2,I*exp(b*x+a))/b^2

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 3, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {4265, 2317, 2438} \begin {gather*} \frac {2 (c+d x) \text {ArcTan}\left (e^{a+b x}\right )}{b}-\frac {i d \text {Li}_2\left (-i e^{a+b x}\right )}{b^2}+\frac {i d \text {Li}_2\left (i e^{a+b x}\right )}{b^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*x)*Sech[a + b*x],x]

[Out]

(2*(c + d*x)*ArcTan[E^(a + b*x)])/b - (I*d*PolyLog[2, (-I)*E^(a + b*x)])/b^2 + (I*d*PolyLog[2, I*E^(a + b*x)])
/b^2

Rule 2317

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 4265

Int[csc[(e_.) + Pi*(k_.) + (Complex[0, fz_])*(f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[-2*(c +
 d*x)^m*(ArcTanh[E^((-I)*e + f*fz*x)/E^(I*k*Pi)]/(f*fz*I)), x] + (-Dist[d*(m/(f*fz*I)), Int[(c + d*x)^(m - 1)*
Log[1 - E^((-I)*e + f*fz*x)/E^(I*k*Pi)], x], x] + Dist[d*(m/(f*fz*I)), Int[(c + d*x)^(m - 1)*Log[1 + E^((-I)*e
 + f*fz*x)/E^(I*k*Pi)], x], x]) /; FreeQ[{c, d, e, f, fz}, x] && IntegerQ[2*k] && IGtQ[m, 0]

Rubi steps

\begin {align*} \int (c+d x) \text {sech}(a+b x) \, dx &=\frac {2 (c+d x) \tan ^{-1}\left (e^{a+b x}\right )}{b}-\frac {(i d) \int \log \left (1-i e^{a+b x}\right ) \, dx}{b}+\frac {(i d) \int \log \left (1+i e^{a+b x}\right ) \, dx}{b}\\ &=\frac {2 (c+d x) \tan ^{-1}\left (e^{a+b x}\right )}{b}-\frac {(i d) \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{a+b x}\right )}{b^2}+\frac {(i d) \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{a+b x}\right )}{b^2}\\ &=\frac {2 (c+d x) \tan ^{-1}\left (e^{a+b x}\right )}{b}-\frac {i d \text {Li}_2\left (-i e^{a+b x}\right )}{b^2}+\frac {i d \text {Li}_2\left (i e^{a+b x}\right )}{b^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(127\) vs. \(2(61)=122\).
time = 0.10, size = 127, normalized size = 2.08 \begin {gather*} \frac {b c \text {ArcTan}(\sinh (a+b x))+\frac {1}{2} d \left (-\left ((-2 i a+\pi -2 i b x) \left (\log \left (1-i e^{a+b x}\right )-\log \left (1+i e^{a+b x}\right )\right )\right )+(-2 i a+\pi ) \log \left (\cot \left (\frac {1}{4} (2 i a+\pi +2 i b x)\right )\right )-2 i \left (\text {PolyLog}\left (2,-i e^{a+b x}\right )-\text {PolyLog}\left (2,i e^{a+b x}\right )\right )\right )}{b^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x)*Sech[a + b*x],x]

[Out]

(b*c*ArcTan[Sinh[a + b*x]] + (d*(-(((-2*I)*a + Pi - (2*I)*b*x)*(Log[1 - I*E^(a + b*x)] - Log[1 + I*E^(a + b*x)
])) + ((-2*I)*a + Pi)*Log[Cot[((2*I)*a + Pi + (2*I)*b*x)/4]] - (2*I)*(PolyLog[2, (-I)*E^(a + b*x)] - PolyLog[2
, I*E^(a + b*x)])))/2)/b^2

________________________________________________________________________________________

Maple [A]
time = 0.50, size = 101, normalized size = 1.66

method result size
derivativedivides \(\frac {\frac {d \left (i \left (b x +a \right ) \left (\ln \left (1-i {\mathrm e}^{b x +a}\right )-\ln \left (1+i {\mathrm e}^{b x +a}\right )\right )-i \dilog \left (1+i {\mathrm e}^{b x +a}\right )+i \dilog \left (1-i {\mathrm e}^{b x +a}\right )\right )}{b}-\frac {2 d a \arctan \left ({\mathrm e}^{b x +a}\right )}{b}+2 c \arctan \left ({\mathrm e}^{b x +a}\right )}{b}\) \(101\)
default \(\frac {\frac {d \left (i \left (b x +a \right ) \left (\ln \left (1-i {\mathrm e}^{b x +a}\right )-\ln \left (1+i {\mathrm e}^{b x +a}\right )\right )-i \dilog \left (1+i {\mathrm e}^{b x +a}\right )+i \dilog \left (1-i {\mathrm e}^{b x +a}\right )\right )}{b}-\frac {2 d a \arctan \left ({\mathrm e}^{b x +a}\right )}{b}+2 c \arctan \left ({\mathrm e}^{b x +a}\right )}{b}\) \(101\)
risch \(\frac {2 c \arctan \left ({\mathrm e}^{b x +a}\right )}{b}-\frac {i d \ln \left (1+i {\mathrm e}^{b x +a}\right ) x}{b}-\frac {i d \ln \left (1+i {\mathrm e}^{b x +a}\right ) a}{b^{2}}+\frac {i d \ln \left (1-i {\mathrm e}^{b x +a}\right ) x}{b}+\frac {i d \ln \left (1-i {\mathrm e}^{b x +a}\right ) a}{b^{2}}-\frac {i d \dilog \left (1+i {\mathrm e}^{b x +a}\right )}{b^{2}}+\frac {i d \dilog \left (1-i {\mathrm e}^{b x +a}\right )}{b^{2}}-\frac {2 d a \arctan \left ({\mathrm e}^{b x +a}\right )}{b^{2}}\) \(147\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)*sech(b*x+a),x,method=_RETURNVERBOSE)

[Out]

1/b*(d/b*(I*(b*x+a)*(ln(1-I*exp(b*x+a))-ln(1+I*exp(b*x+a)))-I*dilog(1+I*exp(b*x+a))+I*dilog(1-I*exp(b*x+a)))-2
*d/b*a*arctan(exp(b*x+a))+2*c*arctan(exp(b*x+a)))

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*sech(b*x+a),x, algorithm="maxima")

[Out]

2*d*integrate(x*e^(b*x + a)/(e^(2*b*x + 2*a) + 1), x) - 2*c*arctan(e^(-b*x - a))/b

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 157 vs. \(2 (48) = 96\).
time = 0.40, size = 157, normalized size = 2.57 \begin {gather*} \frac {i \, d {\rm Li}_2\left (i \, \cosh \left (b x + a\right ) + i \, \sinh \left (b x + a\right )\right ) - i \, d {\rm Li}_2\left (-i \, \cosh \left (b x + a\right ) - i \, \sinh \left (b x + a\right )\right ) + {\left (i \, b c - i \, a d\right )} \log \left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right ) + i\right ) + {\left (-i \, b c + i \, a d\right )} \log \left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right ) - i\right ) + {\left (-i \, b d x - i \, a d\right )} \log \left (i \, \cosh \left (b x + a\right ) + i \, \sinh \left (b x + a\right ) + 1\right ) + {\left (i \, b d x + i \, a d\right )} \log \left (-i \, \cosh \left (b x + a\right ) - i \, \sinh \left (b x + a\right ) + 1\right )}{b^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*sech(b*x+a),x, algorithm="fricas")

[Out]

(I*d*dilog(I*cosh(b*x + a) + I*sinh(b*x + a)) - I*d*dilog(-I*cosh(b*x + a) - I*sinh(b*x + a)) + (I*b*c - I*a*d
)*log(cosh(b*x + a) + sinh(b*x + a) + I) + (-I*b*c + I*a*d)*log(cosh(b*x + a) + sinh(b*x + a) - I) + (-I*b*d*x
 - I*a*d)*log(I*cosh(b*x + a) + I*sinh(b*x + a) + 1) + (I*b*d*x + I*a*d)*log(-I*cosh(b*x + a) - I*sinh(b*x + a
) + 1))/b^2

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (c + d x\right ) \operatorname {sech}{\left (a + b x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*sech(b*x+a),x)

[Out]

Integral((c + d*x)*sech(a + b*x), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*sech(b*x+a),x, algorithm="giac")

[Out]

integrate((d*x + c)*sech(b*x + a), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \frac {c+d\,x}{\mathrm {cosh}\left (a+b\,x\right )} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*x)/cosh(a + b*x),x)

[Out]

int((c + d*x)/cosh(a + b*x), x)

________________________________________________________________________________________